package main

import (
	"fmt"
	"reflect"
)

type Rreflect struct {
	i int `json:"int"`
}

func main() {
	a := 3.14
	atype := reflect.TypeOf(a)
	avalue := reflect.ValueOf(&a)
	avalue.Elem().SetFloat(4.33)
	fmt.Println(a)

	fmt.Println(atype.Kind())
	if avalue.IsZero() {
		fmt.Println("a is zero")
	}
	fmt.Println(atype, avalue)

	typeOf := reflect.TypeOf(Rreflect{})
	field := typeOf.Field(0)
	fmt.Println(field)
	fmt.Println(field.Name, field.Index, field.Tag.Get("json"), field.Type)
	fmt.Println(field.Tag.Get("json"))
	fmt.Println(field.Tag.Get("json"), field.Type)
}
